﻿using System.Web.Mvc;
using Vidh.SimplyToDo.Controllers.ViewModels;

namespace Vidh.SimplyToDo.Controllers.Controller
{
    public class HomeController : BaseController
    {
        //
        // GET: /Home/
        public ActionResult Index()
        {
            return View();
        }

        [HttpPost]
        public ActionResult Index(LoginModel model)
        {
            var valid = model.Authenticate(ModelState);

            if (valid)
            {
                return RedirectToAction("Index", "Members");
            }

            return View();
        }
    }
}
